<?php 
header("content-type:text/html;charset=utf-8"); 
ini_set("magic_quotes_runtime",0); 
require 'PHPMailer/phpmailer.php'; 
require 'PHPMailer/SMTP.php'; 
require 'PHPMailer/Exception.php'; 
use PHPMailer\PHPMailer as mailer;
try { 
$mail = new mailer\PHPMailer(true); 
$mail->IsSMTP(); 
$mail->CharSet='UTF-8'; //设置邮件的字符编码，这很重要，不然中文乱码 
$mail->SMTPAuth = true; //开启认证 
$mail->Port = 25; 
$mail->Host = "smtp.163.com";          //邮件服务器地址
$mail->Username = "15754845103@163.com";   //发送邮件的邮箱地址
$mail->Password = "363633215ws6";   //发送邮件的邮箱密码
//$mail->IsSendmail(); //如果没有sendmail组件就注释掉，否则出现“Could not execute: /var/qmail/bin/sendmail ”的错误提示 
$mail->AddReplyTo("15754845103@163.com","轩");//回复地址 
$mail->From = "15754845103@163.com";   //发送邮件的邮箱地址
$mail->FromName = "轩"; 
$to = $email;        //手收邮件的邮箱地址
$mail->AddAddress($to); 
$mail->Subject = "悦啦啦啦啦啦啦啦啦啦啦啦啦啦啦"; 
$mail->Body = "是否确定注册，如是请点击下列地址，如否请无视！"; 
$mail->AltBody = "对不起该邮箱不支持HTML，请复制地址去浏览器运行!"; //当邮件不支持html时备用显示，可以省略 
$mail->WordWrap = 80; // 设置每行字符串的长度 
//$mail->AddAttachment("f:/test.png"); //可以添加附件 
$mail->IsHTML(true); 
$mail->Send(); 
//echo '邮件已发送'; 
} catch (phpmailerException $e) { 
//echo "邮件发送失败：".$e->errorMessage(); 
} 
?> 